<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html-el" %>
<%@ taglib uri="http://amc.af.mil/radtaglibrary" prefix="rad" %>
<%@ taglib uri="http://amc.af.mil/portal-el" prefix="portal" %>

<html>
<head>
    <title>Add Equipment Item</title>
</head>

<body>

<rad:useBean id="adpeAccountViewHelper"/>
<rad:useBean id="equipmentTypeViewHelper"/>
<%--<rad:useBean id="itemStatusViewHelper"/>--%>
<rad:useBean id="manufacturerViewHelper"/>
<rad:useBean id="modelViewHelper"/>

<div id="portal-left-bar">
    <jsp:include page="../navigation/navigationMenu.jsp"/>
</div>

<div id="portal-content">
<div id="addEquipmentItem">
<portal:box title="Add Single Item" style="width:800px">

<portal:subSection title="Item Information">
<html:form method="post" action="createEquipmentItem.do" styleId="addItemForm">
<html:hidden property="itemId"/>

<p><label for="itemTypeId">Item Type</label>
    <html:select property="itemTypeId"
                 onchange="javascript:chainSelect('itemTypeId','manufacturerId','getManufacturerByEquipmentTypeAction.do');return null;"
                 styleId="itemTypeId">
        <html:option value="">Choose Type</html:option>
        <html:optionsCollection filter="false"
                                name="equipmentTypeViewHelper"
                                property="all"
                                label="name"
                                value="id"/>
    </html:select></p>

<p><label for="manufacturer">Manufacturer</label>
    <html:select property="manufacturerId"
                 onchange="javascript:chainSelect('manufacturerId','modelId','itemModel/getByManufacturer.do');"
                 styleId="manufacturerId">
        <html:option value="">Choose Manufacturer</html:option>
        <html:optionsCollection name="manufacturerViewHelper"
                                property="all"
                                label="name"
                                value="id"
                                filter="false"/>
    </html:select></p>

<p><label for="model">Model</label>
    <html:select property="modelId" styleId="modelId">
        <%--                            <html:optionsCollection name="modelViewHelper"
        property="all"
        label="name"
        value="id"
        filter="false"/>--%>
    </html:select>
    <html:link href="#" title="Create Model"
               onclick="addItemPopupNewModel('Create Model'); return false;">
        Create Model
    </html:link>

    <p><label for="ipmsNumber">IPMS Number</label>
        <html:text property="ipmsNumber" maxlength="14"/></p>

    <p><label for="serialNumber">Serial Number</label>
        <html:text property="serialNumber" maxlength="25"/></p>


        <%--<html:text property="model" maxlength="50"/>--%></p>

<p><label for="description">Description</label>
    <html:text property="description" maxlength="100"/></p>

<p><label for="purchaseDate">Purchase Date</label>
    <html:text property="purchaseDate" maxlength="15"/></p>

<p><label for="purchaseCost">Purchase Cost</label>
    <html:text property="purchaseCost" maxlength="12"/></p>

<p><label for="adpeAccountId">ADPE Account</label>
    <html:select property="adpeAccountId" value="${sessionScope.accountId}">
        <html:optionsCollection filter="false"
                                name="adpeAccountViewHelper"
                                property="all"
                                label="name"
                                value="id"/>

    </html:select></p>

<%--                    <p><label for="statusId">Item Status</label>
                        <html:select property="statusId">
                            <html:optionsCollection filter="false"
                                                    name="itemStatusViewHelper"
                                                    property="all"
                                                    label="status"
                                                    value="id"/>
                        </html:select></p>--%>

<p>             <label for="itemStatusId">Item Status</label>
                <html:select property="itemStatusId">
                <html:option value="0">Active</html:option>
                <html:option value="1">Inactive</html:option>
                <html:option value="2">Pending DRMO</html:option>
                <html:option value="3">DRMO</html:option>
                <html:option value="4">Pending ROS</html:option>
                <html:option value="5">ROS</html:option>
            </html:select>

</p>
<%--                <p><label for="itemConditionId">Item Condition</label>
    <html:select property="itemConditionId">
        <html:optionsCollection filter="false"
                name="itemConditionViewHelper"
                property="all"
                label="description"
                value="id" />

    </html:select>
</p>--%>

<p><html:submit title="Add Item"/></p>
</html:form>
</portal:subSection>

</portal:box>
</div>
</div>

</body>
</html>